package com.sky.mapper;

import com.sky.dto.ShoppingCartDTO;
import com.sky.entity.ShoppingCart;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ShoppingCartMapper {

    ShoppingCart select(@Param("userId") Long userId, @Param("scd") ShoppingCartDTO shoppingCartDTO);

    void insert(ShoppingCart shoppingCart);

    void update(ShoppingCart shoppingCart);

    List<ShoppingCart> selectByUserId(Long userId);

    @Delete("delete from shopping_cart where user_id=#{userId}")
    void cleanByUserId(Long userId);

    void deleteOne(Long userId, ShoppingCart shoppingCart);

    List<ShoppingCart> list(ShoppingCart shoppingCart);
}
